#pragma once

#include "Device\Port.h"
#include "Database\DBHelper.h"


class CPortManager
{
private:
	CPortManager();
	~CPortManager();


public:
	static CPortManager* GetInstance();


	UINT16 AllocId(UINT16 pos);
	CPort* GetPortAt(int pos);
	CPort* GetPortById(UINT id);
	void   LoadConfig();
	void   Reborn();

	UINT   GetAlarmRecordVirginNumber();

private:
	CPort  mPorts[PORT_MAX_NUM];
	UINT16 mIdPosMap[PORT_MAX_NUM];
};
